const koa = require("koa");
// const Router = require("koa-router");
const app = new koa();
// const router = new Router();
const router = require("koa-router")();
const bodyParser = require("koa-bodyparser")
router.get("/",async ctx=>{
    ctx.body="get/post"
})
router.get("/get",async ctx=>{
    ctx.body="get请求"
})
router.post("/post",async ctx=>{
    console.log(ctx.request.body);
    ctx.body="post请求"
})
app.use(bodyParser());
app.use(router.routes());
app.listen(80);